﻿
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
       "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<link rel="stylesheet" type="text/css" href="../style.css">
<meta http-equiv="content-type" content="text/html; charset=utf-8">
</head>
<body>
<?php
	include("../inc/joomlaInt_admin.php");
	
	include("../inc/inc_configuration.php");
	
if ($jUser==0)
{
	echo "Bitte zuerst einloggen!";
}
else
{

$q="SELECT gid FROM $tbl_users WHERE id=$jUser";
					$qe=mysql_query($q);
					$qeo=mysql_fetch_object($qe);
					
					$gid=$qeo->gid;
					
					if ($gid!=$admingroup)
					{
						echo "Du bist kein Admin!";
						break;
					}

echo '
<form action="liga_anlegen_v.php" method="post">
<table class="nb">
	<tr>
		<td>Name:</td>
		<td><input type="text" size="17" name="name"></td>
	</tr>
	<tr>
		<td>Anzahl der Teams (nur bei Liga):</td>
		<td><input type="text" size="17" name="teamAnz"></td>
	</tr>
	<tr>
		<td>Ligatyp:</td>
		<td>
			<select name="type" Size="1">
				<Option Value="1">Liga</option>
				<Option Value="2">Internationale Liga (CL,EL)</option>
				<Option Value="3">KO-Turnier</option>
			</select>
		</td>
	</tr>
	<tr>
		<td>Bild auswählen:</td>
		<td>';
			
				//Bild auswählen
			
				
				
				$lpath = "img/leagues/";
				
				$query = "	SELECT
								id,
								picname AS name,
								path
							FROM
								$tbl_leaguepics lp
							";
							
				$q = mysql_query($query);
				$qc = mysql_num_rows($q);
				
				if ($qc>0)
				{
					echo "<table>";
				
				
					while ($row = mysql_fetch_object($q))
					{
						echo 	'	<tr>
										<td width="5%"><input type="radio" name="pic" value="',$row->id,'"></td>';
						echo 	"		<td width='90%'><img src='../$lpath",$row->path,"' width='50' height='50' alt='TEST'></td>
										<td width='5%'><a href='lp_entfernen.php?id=",$row->id,"' class='minibutton entfernen'></a></td>
									</tr>";
					}
					
					echo "	</table>
							<br><br>";
				}
				
				echo "<a href='picupload.php' class='button anlegen'>Bild hochladen</a>";
				

				
				
			?>
		</td>
	</tr>
</table>
<br>
<input type="submit" class="button eintragen" value="OK">
</form>

<br><br>
			<center><a href='javascript:window.history.back()' class='button zurueck'>Zurück</a></center>
<?php } ?>
</body>
</html>